set(TiRedis_sources)

list(APPEND TiRedis_sources kv/2pc.cc)
list(APPEND TiRedis_sources kv/Backoff.cc)
list(APPEND TiRedis_sources kv/Cluster.cc)
list(APPEND TiRedis_sources kv/LockResolver.cc)
list(APPEND TiRedis_sources kv/RegionCache.cc)
list(APPEND TiRedis_sources kv/RegionClient.cc)
list(APPEND TiRedis_sources kv/Rpc.cc)
list(APPEND TiRedis_sources kv/Snapshot.cc)
list(APPEND TiRedis_sources kv/Scanner.cc)
list(APPEND TiRedis_sources pd/Client.cc)
list(APPEND TiRedis_sources logger/TLogger.cc)
list(APPEND TiRedis_sources threads/ThreadPool.cc)
list(APPEND TiRedis_sources coprocessor/Client.cc)
list(APPEND TiRedis_sources utils/RedactHelpers.cc)
list(APPEND TiRedis_sources socket/Socket.cc)
list(APPEND TiRedis_sources socket/Epoller.cc)
list(APPEND TiRedis_sources socket/ListenSocket.cc)
list(APPEND TiRedis_sources socket/StreamSocket.cc)
list(APPEND TiRedis_sources socket/NetThreadPool.cc)
list(APPEND TiRedis_sources socket/Server.cc)
list(APPEND TiRedis_sources socket/TaskManager.cc)
list(APPEND TiRedis_sources cmd/Cmd.cc)
list(APPEND TiRedis_sources executors/Executor.cc)
list(APPEND TiRedis_sources tiredis/Common.cc)
list(APPEND TiRedis_sources cli/Client.cc)
list(APPEND TiRedis_sources datastruct/TString.cc)
list(APPEND TiRedis_sources parser/ProtoParser.cc)
list(APPEND TiRedis_sources conf/Config.cc)
list(APPEND TiRedis_sources buffers/UnboundedBuffer.cc)
list(APPEND TiRedis_sources stat/Statistics.cc)
list(APPEND TiRedis_sources server/TServerCommand.cc)
list(APPEND TiRedis_sources buffers/AsyncBuffer.cc)

set(tiRedis_INCLUDE_DIR ${tiRedis_SOURCE_DIR}/include)

add_library(ti_redis ${TiRedis_sources})
target_include_directories(ti_redis PUBLIC ${KVPROTO_INCLUDE_DIR} ${tiRedis_INCLUDE_DIR} ${fiu_include_dirs})
target_link_libraries(ti_redis kvproto ${Poco_Foundation_LIBRARY} fiu gRPC::grpc++)

add_subdirectory (tiredis)
add_subdirectory (tests)
